//继承 整体思路：实例方法和属性的继承、原型属性和方法的 分别继承

//生成指定原型对象的对象
function create(proto){
    function F(){}
    F.prototype = proto;
    return new F();
}

function Parent(name){
    this.name = name;
}

Parent.prototype.sayName = function(){
    console.log("this.name");
}

function Child(age, name){
    Parent.call(this.name);
    this.age = age;
}

Child.prototype = create(Parent.prototype);
Child.prototype.constructor = Child;

Child.prototype.sayAge = function(){
    console.log(this.age);
}
var child = new Child(30,"katy");
child.sayName();
child.sayAge();
